<?php

include '../init.php';

// 数据库文件
include DIR_CORE.'/MySQLDB.php';

// 查询总记录数
$sql = "select count(*) from publish";
$rowCount = fetchColumn($sql);

// 载入配置文件
$config = include DIR_CONFIG . '/config.php';
$rowsPerPage = $config['page']['rowsPerPage'];
$maxnum = $config['page']['maxnum'];
$url = './list_father.php';

// 载入分页文件
include DIR_CORE.'/page.php';
$strPage = page($rowCount, $maxnum, $rowsPerPage, $url);
$pageNum = isset($_GET['pageNum']) ? $_GET['pageNum'] : 1;

// 提取 publish 表中的数据
$offset = ($pageNum - 1) * $rowsPerPage;
$sql = "select * from publish left join user on pub_owner = user_name order by pub_time desc limit $offset, $rowsPerPage";
$result = my_query($sql);

include DIR_VIEW.'/list_father.html';

?>
